	
(
	var synth;
	
	// *** synth 
	synth={arg density=2, pitchRatio=1, pan=0, delay=0, mix=0, room=0;
		var x;
		density=density * 10;
		pitchRatio=pitchRatio * 4;
		pan=(2*pan) - 1;
		delay=delay*2;
		mix=mix;
		room=room;
		[\d, density, \p,pitchRatio].postln;
		x = Klank.ar(
			`[[200, 671, 1153, 1723], nil, [1, 1, 1, 1]], 
			Dust.ar(density: density, mul:0.1));
		x = PitchShift.ar(
			in:x, windowSize:1, pitchRatio: pitchRatio, 
			pitchDispersion:0, timeDispersion:0.1, mul:1, add:0);
		x = Pan2.ar(x, pan);
		x = [x[0], DelayC.ar(x[1], maxdelaytime:2, delaytime:delay)]; // de-correlate
		FreeVerb.ar(x, mix:mix, room:room, damp:0.5);
		
	}.scope;
	
	// *** control
	
	w = Window("M", Rect(100,Window.screenBounds.height-400, 600 ,300));
	w.view.decorator = FlowLayout(w.view.bounds);
	t = Slider2D(w, Rect(0, 0,100, 100)).y_(0).x_(0).action_({|sl|
				synth.set(\density,sl.x,\pitchRatio,sl.y); });
	t.step_(0.01);
	u = Slider2D(w, Rect(0, 0,100, 100)).y_(0).x_(0).action_({|sl|
				synth.set(\pan,sl.x,\delay,sl.y); });
	v = Slider2D(w, Rect(0, 0,100, 100)).y_(0).x_(0).action_({|sl|
				synth.set(\mix,sl.x,\room,sl.y); });
	k = Knob.new(w, Rect(20, 10, 48, 48));
	k.action_({|v,x,y,m| postf("action func called: %\n", v.value); });
	//p = StaticText(w,Rect(10,10,200,20));
	//p.string("test");
	
	f = SCFreqScope(Rect(0,0,400,300)); //w, w.view.bounds);
	f.active_(true); 	
		
	w.front;
	CmdPeriod.doOnce({w.close});
)





